<template>
  <div>
    <van-cell title="户  型" :value="roomType? roomType.label:'请选择'" @click="value = true" is-link />
    <van-popup v-model="value" position="bottom" :style="{ height: '40%' }">
      <van-picker
        show-toolbar
        :columns="row"
        value-key="label"
        @confirm="onConfirm"
        @cancel="value = false"
      />
    </van-popup>
  </div>
</template>

<script>
export default {
  name: 'roomType',
  props: {
    row: {
      type: Array,
      required: true
    }
  },
  data () {
    return {
      value: false,
      roomType: ''
    }
  },

  created () {},

  methods: {
    onConfirm (val) {
      console.log(val.value)
      this.roomType = val
      this.$emit('getRoomType', this.roomType)
      this.value = false
    }
  }
}
</script>

<style scoped lang="less">
// .van-cell {
//   color: #108ee9;
//   font-size: 34px;
// }
</style>
